import { getCinemaList } from '@/api/film'

const module = {
    namespaced: true,
    state: {
        cinemaList: []
    },
    mutations: {
        setCinemaList(state, cinemaList) {
            state.cinemaList = cinemaList
        }
    },
    actions: {
        async getCinemaList({ commit }, cityId) {
            const { data } = await getCinemaList(cityId)
            commit('setCinemaList', data.data.cinemas)
        }
    }
}

export default module